'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const ProjectSchema = new Schema({
    userId: { type: String, index: true },
    projectId: { type: Schema.Types.ObjectId, ref: 'Project' },
    username: { type: String },
    headimg: { type: String },
    createTime: { type: Date },
  });

  return mongoose.model('Vote', ProjectSchema);
};
